//
//  SDHSportsMatchDateCell.m
//  SDHSportsNews
//
//  Created by MichaelShan on 2021/3/4.
//

#import "SDHSportsMatchDateCell.h"

@implementation SDHSportsMatchDateCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initUI];
    }
    
    return self;
}

- (void)initUI {
    self.contentView.backgroundColor = UIColorFromRGB(100, 100, 100);
    
    UILabel *label = [UILabel new];
    label.numberOfLines = 1;
    label.font = [UIFont boldSystemFontOfSize:18];
    label.textColor = UIColorFromRGBA(35, 36, 38, 1);
    [self.contentView addSubview:label];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    UIView *superview = self.contentView;
    CGFloat padding = 10;
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(superview).insets(UIEdgeInsetsMake(10, 30, 5, 20));
    }];
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"MM/dd"];
    NSString *dateStr = [formatter stringFromDate:[NSDate date]];
    label.text = dateStr;
    self.dateLabel = label;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)updateContent:(id)object {
    self.dateLabel.text = object;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
